home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 27 / CU Amiga Magazine's Super CD-ROM 27 (1998)(EMAP Images)(GB)[!][issue 1998-10].iso / CUCD / Programming / THXPlayLib / src / volume.asm < prev   
Encoding:
Assembly Source File  |  1998-05-11  |  1.5 KB  |  77 lines

  1. ;****** thxplay.library/thxGetVolume ******************************************
  2. ;
  3. ;   NAME
  4. ;       thxGetVolume -- get master volume.
  5. ;
  6. ;   SYNOPSIS
  7. ;       volume = thxGetVolume()
  8. ;       D0-0:6
  9. ;
  10. ;       ULONG thxGetVolume(void);
  11. ;
  12. ;       volume := thxGetVolume()
  13. ;
  14. ;   FUNCTION
  15. ;       Returns the current master volume value. Does not stop play.
  16. ;
  17. ;   RESULT
  18. ;       volume - current volume setting from 0 (silent) to 64 (loudest)
  19. ;
  20. ;   SEE ALSO
  21. ;       thxSetVolume()
  22. ;
  23. ;****************************************************************************
  24. ;
  25. ;
  26.     cnop    0,4
  27. thxGetVolume
  28.     move.l    THX+thxBSS_P(pc),d0
  29.     beq.s    .exit
  30.     move.l    d0,a0
  31.     moveq    #0,d0
  32.     move.b    thx_pMainVolume(a0),d0
  33. .exit    rts
  34.  
  35.  
  36. ;****** thxplay.library/thxSetVolume ******************************************
  37. ;
  38. ;   NAME
  39. ;       thxSetVolume -- set master volume.
  40. ;
  41. ;   SYNOPSIS
  42. ;       void thxSetVolume(volume)
  43. ;                         D0-0:6
  44. ;
  45. ;       void thxSetVolume(ULONG);
  46. ;
  47. ;       thxSetVolume(volume)
  48. ;
  49. ;   FUNCTION
  50. ;       Sets the master volume. Does not stop play.
  51. ;
  52. ;   INPUTS
  53. ;       volume - from 0 (silent) to 64 (loudest)
  54. ;
  55. ;   NOTE
  56. ;       This  function  can take up to two frames to take an audible effect.
  57. ;       If the song is paused, will not take effect until unpaused.
  58. ;
  59. ;   SEE ALSO
  60. ;       thxGetVolume()
  61. ;
  62. ;****************************************************************************
  63. ;
  64. ;
  65.     cnop    0,4
  66. thxSetVolume
  67.     ifd    STACKARGS
  68.     move.l    4(sp),d0
  69.     endc
  70.     cmp.b    #64,d0
  71.     bhi.s    .exit
  72.     move.l    THX+thxBSS_P(pc),d1
  73.     beq.s    .exit
  74.     move.l    d1,a0
  75.     move.b    d0,thx_pMainVolume(a0)
  76. .exit    rts
  77.